library(haven)
library(reshape2)                                        

main_recoded_for_appendix_fig <- read_dta("main_recoded_for_appendix_fig.dta")                           

data_long <- melt(main_recoded_for_appendix_fig)   

p<- ggplot(data_long, aes(x = variable, y = value)) +           
  geom_boxplot() +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) 

p + labs(title="Election Confidence by Party and Condition", 
         x = "Partisanship and Condition",
         y = "Election Confidence Index",
         caption = "Boxplots of Election Confidence by Party and Condition")
